OBJS =  scanner.cmo ast.cmo parser.cmo compile.cmo descartes.cmo

TARFILES = Makefile scanner.mll parser.mly \
	ast.ml compile.ml descartes.ml \

descartes : $(OBJS)
	ocamlc -o descartes.exe $(OBJS)
	
descartes : $(OBJS)

.PHONY : test
test : descartes.exe testall.sh
	./testall.sh
	
.PHONY : blackjack
blackjack : test-blackjack.pl
	perl test-blackjack.pl
	
.PHONY : highlow
highlow : test-highlow.pl
	perl test-highlow.pl
	
.PHONY : helloworld
helloworld: test-decktest.pl
	perl test-decktest.pl	
		
scanner.ml : scanner.mll
	ocamllex scanner.mll	
	
parser.ml parser.mli : parser.mly
	ocamlyacc parser.mly

%.cmo : %.ml
	ocamlc -c $<
	
%.cmi : %.mli
	ocamlc -c $<	

.PHONY : clean
clean :
	rm -f descartes.exe parser.ml parser.mli scanner.ml testall.log \
	*.cmo *.cmi *.out *.diff *.pl *.mli *.cmi
	
#Generated by ocamldep *.ml *.mli
ast.cmo:
ast.cmx:
compile.cmo: ast.cmo 
compile.cmx: ast.cmx 
descartes.cmo: scanner.cmo parser.cmi compile.cmo \
    ast.cmo 
descartes.cmx: scanner.cmx parser.cmx compile.cmx \
    ast.cmx 
parser.cmo: ast.cmo parser.cmi 
parser.cmx: ast.cmx parser.cmi 
scanner.cmo: parser.cmi 
scanner.cmx: parser.cmx 
parser.cmi: ast.cmo
